#!/bin/bash
if [ ! -n "${1}" ]; then
        echo "ERROR! param error, request rootPassword"
        exit 0;
fi
slaveName=`mysql -uroot -p${1} -e "select user from mysql.user" | grep slave`
if [ ! -n "$slaveName" ]
	then
	mysql -uroot -p${1} < /usr/local/data/add-slave-user.sql
fi
echo `mysql -uroot -p${1} -e "show master status" | grep mysql-bin`
